const express = require('express');
const app = express();

// 引入总路由
const allRouter = require('./router');
// 端口配置
const {PORT} = require('./config.json');
// 启动静态资源服务器，以dist文件夹作为根目录
app.use(express.static('./dist'));

// 当路径为local:2003/api时才可进入该端口
app.use('/api',allRouter)

// 启动服务器
app.listen(PORT,()=>{
    console.log('server is running on port '+PORT+' !');
})